from my_api import *
# from language import get_locale_text as _

SYS_TICK = 0.02

MAIN_VERSION = 2
SUB_VERSION = 0
BUILD_VERSION = 77

LOG_FILE_PATH = 'log'
IMAGE_FILE_PATH = resource_path('image')
WIN32_FILE_PATH = resource_path('win32')
# WIN32_FILE_PATH = 'win'
DEV_FILE_PATH = resource_path('dev')
LOCALE_FILE_PATH = resource_path('locale')
PROJECT_FILE_PATH = 'project'
CONFIG_FILE_PATH = 'config'
RESOURCE_FILE_PATH = 'resource'
EXE_FILE_PATH = 'exe'
LUA_8955_FILE_PATH = '8955_lua_lod'
LUA_1802_FILE_PATH = '1802_lua_lod'
LUA_1802S_FILE_PATH = '1802s_lua_lod'
LUA_1601_FILE_PATH = '1601_lua_lod'
LUA_RDA8910_FILE_PATH = '8910_lua_lod'
AT_8955_TTS_FILE_PATH = '8955_at_tts_lod'
AT_8955_SSL_FILE_PATH = '8955_at_ssl_lod'
AT_1802_FILE_PATH = '1802_at_lod'
AT_1802S_FILE_PATH = '1802s_at_lod'
AT_1601_FILE_PATH = '1601_at_lod'
AT_RDA8910_FILE_PATH = '8910_at_lod'
DEMO_8955_202_FILE_PATH = '8955_202_lod'
DEMO_8955_800_FILE_PATH = '8955_800_lod'
SCRIPT_OLD_FILE_PATH = '8955_old_script'
SCRIPT_8955_FILE_PATH = '8955_script'
SCRIPT_1802_FILE_PATH = '1802_script'
SCRIPT_RDA8910_FILE_PATH = '8910_script'
TEMP_PATH = '_temp'
DATA_FILE_PATH = 'data'

GLOBAL_FILE = "global.ini"
LANGUAGE_FILE = "language"

DEV_TYPE_AUTO = 'auto'
DEV_TYPE_HOST = 'host'
DEV_TYPE_USB = 'usb'
DEV_TYPE_NET = 'net'

EV_EVENT = 0
EV_VALUE = 1

EV_MODE_SLEEP = 'sleep'
EV_MODE_DOWNLOAD = 'download'
EV_MODE_TRACE = 'trace'

EV_ALL_PRINT = 'all_print'
EV_RDA_TRACE = 'rda_trace'
EV_RDA_EVENT = 'rda_event'
EV_RDA_DATA = 'rda_data'
EV_ASR_TRACE = 'asr_trace'
EV_NET_TRACE = 'net_trace'
EV_NET_TRACE_STATE = 'net_trace_state'
EV_DEBUG = 'debug'
EV_FIND_VERSION = 'find_version'
EV_FIND_TRACE_COM = 'find_com'
EV_RESET_CHIP = 'reset_chip'
EV_RESET_CHIP_AFTER = 'reset_chip_after'
EV_OPEN_COM = 'open_com'
EV_REOPEN_COM = 'reopen_com'
EV_DEV_DOWNLOAD = 'dev_download'
EV_NET_PC_ID = 'net_pc_id'
EV_NET_LOGIN = 'net_login'
EV_NET_UPGRADE_CHECK = 'net_upgrade_check'
EV_NET_UPGRADE = 'net_upgrade'
EV_NET_UPGRADE_CANCEL = 'net_upgrade_cancel'
EV_NET_UPGRADE_PER = 'net_upgrade_per'
EV_NET_RDA = 'net_rda'
EV_NET_USER_NUM = 'net_user_num'
EV_NET_CHECK_PRODUCT = 'net_check_product'
EV_NET_QUIT = "net_quit"

DL_FILE = 'file'
DL_TYPE = 'type'
DL_COM = 'com'
DL_FINISH = 'finish'
DL_RESULT = 'result'
DL_INFO = 'info'
DL_PER = 'per'
DL_USB_BOOT = 'usb_boot'
DL_TYPE_ALL = 'all'
DL_TYPE_SCRIPT = 'script'

NET_TRACE_TX = 'net_trace_tx'
NET_TRACE_ID = 'net_trace_id'
NET_TRACE_CODE = 'net_trace_code'
NET_TRACE_DATA = 'net_trace_data'

UPGRADE_INFO_ID_NEED_REBOOT = 0xfe
UPGRADE_INFO_ID_ALL_FINISH = 0xff

TRACE_DATA = 'data'
TRACE_ID = 'id'
TRACE_LEVEL = 'level'

RDA_LOD_DES = 'description'
RDA_LOD_SECTOR = 'sectors'
RDA_ORG_SDK = 'rda_org_sdk'

RDA_TRACE_ID = ['SXR', 'PAL', 'L1A', 'L1S', 'LAP', 'RLU', 'RLD', 'LLC', 'MM', 'CC', 'SS', 'SMS', 'SM', 'SND', 'API', 'MMI', 'SIM', 'AT', 'M2A', 'STT', 'RRI', 'RRD', 'RLP', 'HAL', 'BCPU', 'CSW', 'EDRV', 'MCI', 'SVC1', 'SVC2', 'WCPU', 'NT']

HTTP_TOOL_URL = "http://pytool.openluat.com/"
HTTP_UPGRADE_URL = "http://pytool.openluat.com/"
HTTP_LOGIN_URL = "http://simew.openluat.com/api/event/login_user"
HTTP_CHECK_URL = "http://luatoolstat.openluat.com/"

CONFIG_UI = 'ui'
CONFIG_UI_X = 'ui_x'
CONFIG_UI_Y = 'ui_y'
CONFIG_UI_PROJ_X = 'ui_project_x'
CONFIG_UI_PROJ_Y = 'ui_project_y'
CONFIG_UI_LANGUAGE = 'ui_language'
CONFIG_MODE = 'mode'
CONFIG_MODE_COM = 'com'
CONFIG_MODE_BR = 'br'
CONFIG_MODE_TYPE = 'type'
CONFIG_MODE_USB_BOOT = "usb_boot"
CONFIG_MODE_TIME = 'time'
CONFIG_LOGIN = 'login'
CONFIG_LOGIN_USER = 'user'
CONFIG_LOGIN_PASSWORD = 'password'
CONFIG_TRACE = 'trace'
CONFIG_TRACE_MAX = 'max'
CONFIG_TRACE_PATH = 'path'
CONFIG_TRACE_EVENT = 'event'
CONFIG_TRACE_STACK_LOG = 'stack'
CONFIG_TRACE_APP_LOG = 'app'
CONFIG_TRACE_RDA_LOG = 'rda'
CONFIG_FIRMWARE = 'firmware'
CONFIG_FIRMWARE_PATH = 'firmware_path'
CONFIG_LUA = 'lua'
CONFIG_LUA_DEBUG = 'debug'


ASR_1802_CORE_SUFFIX = '.blf'
ASR_1601_CORE_SUFFIX = '.zip'
RDA_8910_CORE_SUFFIX = '.pac'
RDA_8955_CORE_SUFFIX = '.lod'
EC616_CORE_SUFFIX = ".ec"
HOST_CORE_SUFFIX = [RDA_8955_CORE_SUFFIX]
USB_CORE_SUFFIX = [ASR_1802_CORE_SUFFIX, ASR_1601_CORE_SUFFIX, RDA_8910_CORE_SUFFIX]
ALL_CORE_SUFFIX = [RDA_8955_CORE_SUFFIX, ASR_1802_CORE_SUFFIX, ASR_1601_CORE_SUFFIX, RDA_8910_CORE_SUFFIX, EC616_CORE_SUFFIX]
DFOTA_CORE_SUFFIX = [RDA_8910_CORE_SUFFIX]

LOCALE_ZH_CH = "zh_CN"
LOCALE_EN_US = "en-US"
LOCALE_AUTO = 'auto'

USB_WAIT_CONNECT_SLEEP = 4.0
